<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>退款页面</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		var purchasenum = ${orders.purchasenum};
		var childnum=${orders.childnum};
		$(document).ready(function() {
			$("#contacts").focus();
			$("#inputForm").validate({
				rules: {
					purchasenum: {required:true,digits:true,purchasenum:true}
				},
				submitHandler: function(form){
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			$.validator.addMethod("purchasenum", function(value, element) {
				return this.optional(element) || (parseInt(value)<=purchasenum);
			}, "取消的数量不超过订单中的数量");
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a>订单退款</a></li>
	</ul>
	<form id="inputForm" action="${ctx}/realsche/doBackMoney" method="post" class="form-horizontal">
		<input type="hidden" name="orderid" value="${orders.orderid }"/>
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label" for="contacts">联系人姓名</label>
			<div class="controls">
				<input type="text" value="${orders.contacts }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="payertel">手机号</label>
			<div class="controls">
				<input type="text" value="${orders.payertel }" readonly/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="purchasenum">退票数（张）</label>
			<div class="controls">
				<input type="text" id="purchasenum" name="purchasenum" value="0" class="input-number">
				<span class="help-inline">共${orders.purchasenum }张</span>
			</div>
		</div>
		<div class="form-actions">
			<input class="btn btn-primary" type="submit" value="确认"/>
			<input class="btn" type="button" value="返回" onclick="history.go(-1)"/>
		</div>
	</form>
</body>
</html>